﻿Public Class frmProductManage

	Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
		Dim SQLString As String = ""
		Dim fAddProduct As frmAddProduct = New frmAddProduct()
		fAddProduct.Text = "Thêm Sản Phẩm"
		fAddProduct.ShowDialog(Me)
		'	If (fAddProduct.DialogResult = Windows.Forms.DialogResult.OK) Then
		'If fAddProduct.AddProduct() = True Then
		'LoadPartsonGrid()
		'Dim FuntionandSubObj As FuntionandSub = New FuntionandSub()
		'FuntionandSubObj.HighlightRow(Me.dgvMaterialList, CurrentPartNumber)

		'dgridviewPartsList_CellClick(Me.dgvMaterialList, Nothing)
		'End If
		'	End If

		If dgvProductList.Rows.Count > 0 Then
			btnEdit.Enabled = True
			btnDelete.Enabled = True
			btnPrint.Enabled = True
		Else
			btnEdit.Enabled = False
			btnDelete.Enabled = False
			btnPrint.Enabled = False
		End If
	End Sub

	Private Sub frmProductManage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		dgvProductList.DataSource = Nothing
    Dim SQLString As String = "SELECT Name FROM tbl_restorationdetail"
		Dim dtAccess As DataBaseAccess = New DataBaseAccess()
		Dim dtTable As DataTable = dtAccess.GetDataTable(SQLString)
		dgvProductList.DataSource = dtTable
	End Sub
End Class